if NOT Exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[OrganizationSetting]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
BEGIN
CREATE TABLE [dbo].[OrganizationSetting](
	[OrganizationCode] [varchar](3) NOT NULL,
	[IsNationalCodeForce] [bit] NULL CONSTRAINT [DF_OrganizationSetting_IsForceNationalCode]  DEFAULT ((0)),
	[IsNoteCodeForce] [bit] NULL CONSTRAINT [DF_OrganizationSetting_IsNoteCodeForce]  DEFAULT ((0)),
	[IsGenderForce] [bit] NULL CONSTRAINT [DF_OrganizationSetting_IsForceGender]  DEFAULT ((0)),
	[IsPatientInfoForce] [bit] NULL CONSTRAINT [DF_OrganizationSetting_IsForcePatientInfo]  DEFAULT ((0)),
	[IsPageNoForce] [bit] NULL CONSTRAINT [DF_OrganizationSetting_IsForcePageNo]  DEFAULT ((0)),
	[IsBirthDateForce] [bit] NULL CONSTRAINT [DF_OrganizationSetting_IsForceBirthDate]  DEFAULT ((0)),
	[IsMobileNoForce] [bit] NULL CONSTRAINT [DF_OrganizationSetting_IsForceMobile]  DEFAULT ((0)),
	[IsContractNumberForce] [bit] NULL CONSTRAINT [DF_OrganizationSetting_IsForceContractNumber]  DEFAULT ((0)),
	[IsVeteranPercentForce] [bit] NULL CONSTRAINT [DF_OrganizationSetting_IsVeteranPercentForce]  DEFAULT ((0)),
	[IsMedicalNoForce] [bit] NULL CONSTRAINT [DF_OrganizationSetting_IsForceMedicalNo]  DEFAULT ((0)),
	[IsSpecialtyForce] [bit] NULL CONSTRAINT [DF_OrganizationSetting_IsForceSpecialty]  DEFAULT ((0)),
	[IsHealthinsurance] [bit] NULL CONSTRAINT [DF_OrganizationSetting_IsHealthinsurance]  DEFAULT ((0)),
	[IsEqualNoteCodeNationalCode] [bit] NULL CONSTRAINT [DF_OrganizationSetting_IsEqualNoteCodeNationalCode]  DEFAULT ((0)),
	[NoteCodeMinLength] [tinyint] NULL CONSTRAINT [DF_OrganizationSetting_NoteCodeMinLength]  DEFAULT ((0)),
	[NoteCodeMaxLength] [tinyint] NULL CONSTRAINT [DF_OrganizationSetting_NoteCodeMaxLength]  DEFAULT ((0)),
 CONSTRAINT [PK_OrganizationSetting] PRIMARY KEY CLUSTERED 
(
	[OrganizationCode] ASC
)
) ON [PRIMARY]

INSERT [dbo].[OrganizationSetting] ([OrganizationCode], [IsNationalCodeForce], [IsNoteCodeForce], [IsGenderForce], [IsPatientInfoForce], [IsPageNoForce], [IsBirthDateForce], [IsMobileNoForce], [IsContractNumberForce], [IsVeteranPercentForce], [IsMedicalNoForce], [IsSpecialtyForce], [IsHealthinsurance], [NoteCodeMinLength], [NoteCodeMaxLength]) VALUES (N'00', 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0)
INSERT [dbo].[OrganizationSetting] ([OrganizationCode], [IsNationalCodeForce], [IsNoteCodeForce], [IsGenderForce], [IsPatientInfoForce], [IsPageNoForce], [IsBirthDateForce], [IsMobileNoForce], [IsContractNumberForce], [IsVeteranPercentForce], [IsMedicalNoForce], [IsSpecialtyForce], [IsHealthinsurance], [NoteCodeMinLength], [NoteCodeMaxLength]) VALUES (N'01', 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
INSERT [dbo].[OrganizationSetting] ([OrganizationCode], [IsNationalCodeForce], [IsNoteCodeForce], [IsGenderForce], [IsPatientInfoForce], [IsPageNoForce], [IsBirthDateForce], [IsMobileNoForce], [IsContractNumberForce], [IsVeteranPercentForce], [IsMedicalNoForce], [IsSpecialtyForce], [IsHealthinsurance], [NoteCodeMinLength], [NoteCodeMaxLength]) VALUES (N'02', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)

END
